package org.nepu.scr;

import cn.hutool.core.lang.Validator;
import cn.hutool.json.JSONUtil;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.nepu.scr.关键性能指标.A4KeyParams;
import org.nepu.scr.实际与设计差异.A2RealityParams;
import org.nepu.scr.操作可靠性.A1OperationParams;
import org.nepu.scr.本质安全.A3NatureParams;
import org.nepu.scr.设备设施资料.A5DeviceParams;

@Data
@ApiModel(value = "符合性评级")
public class ComplianceParams {

    A1OperationParams a1;

    A2RealityParams a2;

    A3NatureParams a3;

    A4KeyParams a4;

    A5DeviceParams a5;

    public ComplianceParams jsonBuild(String jsonStr){
        if (Validator.isEmpty(jsonStr)){
            return new ComplianceParams();
        }
        return JSONUtil.toBean(jsonStr, ComplianceParams.class);
    }
}
